<template>
  <div class="tabs">
    <div :class="['tab', { 'tab-active': active === item.idx }]" v-for="(item, index) in tabs" :key="index">{{ item.name
    }}
    </div>
  </div>
</template>

<script>
export default {
  props: {
    tabs: {
      type: Array,
      default: () => []
    },
    active: {
      type: [String, Number],
      default: 0
    }
  },
  methods: {
    
  }
}
</script>

<style lang="less" scoped>
.tabs {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;

  .tab {
    flex: 1;
    font-size: 16px;
    color: #000;
  }

  .tab-active {
    background-color: aqua;
    font-size: #ffffff;
    position: relative;
  }

  .tab-active::after {
    content: '';
    position: absolute;
    top: 4px;
    width: 100px;
    height: 2px;
    background-color: red;
  }
}
</style>